<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/6/21
 * Time: 下午1:53
 */

namespace app\index\model;


use think\Model;

class ThirdUrl extends Model
{
    protected $table = "t_thirdurl";
    public static function getUrlListByTagId($id){
        $data = self::where('tag_id','=',$id)->select();
        if($data->isEmpty()){
            return[];
        }
        $url_list = [];
        foreach ($data as $item){
            $url_item['title'] = $item["title"];
            $url_item['url'] = $item["url"];
            array_push($url_list,$url_item);
        }
        return $url_list;
    }

}